<template>
  <div class="progress-box">
    <div class="button active-bg">提交信息</div>
    <span :class="{ 'active-bg': [10, 20, 30].includes(props.status) }">
      <i :class="{ 'active-left-border': [10, 20, 30].includes(props.status) }" />
    </span>
    <div class="button" :class="{ 'active-bg': [10, 20, 30].includes(props.status) }">待审批</div>
    <span :class="{ 'active-bg': [20, 30].includes(props.status) }"></span>
    <div class="branch-box">
      <div
        class="top"
        :class="{ 'active-top-border active-left-border': [20].includes(props.status) }"
      >
        <i :class="{ 'active-left-border': [20].includes(props.status) }" />
      </div>
      <div
        class="bottom"
        :class="{ 'active-bottom-border active-left-border': [30].includes(props.status) }"
      >
        <i :class="{ 'active-left-border': [30].includes(props.status) }" />
      </div>
    </div>
    <div class="status-box">
      <div :class="{ 'active-bg': [20].includes(props.status) }" class="button">申请通过</div>
      <div :class="{ 'active-bg': [30].includes(props.status) }" class="button">申请拒绝</div>
    </div>
  </div>
</template>
<script lang="ts" setup>
const props = defineProps({
  status: {
    type: Number,
    default: 0
  }
})
</script>
<style lang="scss" scoped>
.progress-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 1000px;
  padding-bottom: 200px;
  .status-box {
    > div + div {
      margin-top: 100px;
    }
  }
  div.button {
    padding: 20px 50px;
    font-size: 24px;
    font-weight: bold;
    color: #ffffff;
    background-color: #d4d4d4;
    border-radius: 10px;
  }
  > span {
    position: relative;
    flex: 1;
    padding: 2px;
    z-index: 1;
    background-color: #d4d4d4;
    > i {
      position: absolute;
      right: -12px;
      top: -8px;
      content: '';
      border: 10px solid transparent;
      border-left: 20px solid #d4d4d4;
    }
  }
  > .branch-box {
    position: relative;
    width: 60px;
    height: 180px;
    margin-left: -3px;
    > div {
      height: 50%;
    }
    .top {
      border-top: 3px solid #d4d4d4;
      border-left: 3px solid #d4d4d4;
      > i {
        position: absolute;
        right: -12px;
        top: -8px;
        content: '';
        border: 10px solid transparent;
        border-left: 20px solid #d4d4d4;
      }
    }
    .bottom {
      border-bottom: 3px solid #d4d4d4;
      border-left: 3px solid #d4d4d4;
      > i {
        position: absolute;
        right: -12px;
        bottom: -8px;
        content: '';
        border: 10px solid transparent;
        border-left: 20px solid #d4d4d4;
      }
    }
  }
}

.active-bg {
  background-color: #0ea5e9 !important;
}

.active-top-border {
  border-top-color: #0ea5e9 !important;
}

.active-bottom-border {
  border-bottom-color: #0ea5e9 !important;
}

.active-left-border {
  border-left-color: #0ea5e9 !important;
}
</style>
